import React from 'react';
import {
  Switch,
  Route
} from 'react-router-dom';
import { connect } from 'react-redux';

import { appointContainer } from './appoint';
import { personalContainer } from './personal';
import BindTpl from './bind';
import ErrorView from './error_tpl';

import { appInit } from './../actions/a_common';
import 'weui';
import 'react-weui/build/packages/react-weui.css';

class App extends React.Component {

  componentDidMount() {
    this.props.appInit();
  }

  render() {
    return (
      <Switch>
        {/* <Route path="/trumpCourse" component={trumpCourseContainer} /> */}
        <Route path="/appoint" component={appointContainer} />
        <Route path="/personal" component={personalContainer} />
        <Route path='/bind/:periodId?' component={BindTpl} />
        <Route path="/*" component={ErrorView} />
      </Switch>
    )
  }
}

export default connect( (store) => {
  return {
  }
}, {
  appInit
})(App);
